package com.fit.entities;

import java.util.LinkedList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.apache.tapestry5.beaneditor.NonVisual;
import org.apache.tapestry5.beaneditor.Validate;

import com.fit.entities.manytomany.UserDegree;


@Entity
@Table(name="Degree")
public class Degree {
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@NonVisual
	@Column(name = "id", nullable= false)
	private long id;
	@Validate("required")
	@Column(name = "type", nullable=false)
	private String type;
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "pk.degree")
	private List<UserDegree> userDegree = new LinkedList<UserDegree>();
	
	
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public List<UserDegree> getUserDegree() {
		return userDegree;
	}
	public void setUserDegree(List<UserDegree> userDegree) {
		this.userDegree = userDegree;
	}

	
	
	
}
